home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / dc104.arc / DC.DOC < prev    next >
Text File  |  1988-09-14  |  15KB  |  330 lines

  1.                  DC - Directory Control
  2.                       Version 1.04
  3.                    by Peter Esherick
  4.  
  5.            Contact via: Albuquerque PC Users' Group or
  6.            Albuquerque RBBS  296-7672, John Maio, sysop
  7.            Midnight Express  836-9576, Terry Stein, sysop
  8.            Surya             294-9601, Paramjeet Singh, sysop
  9.            ARPANET           <ESHERIC@SANDIA-2.ARPA>
  10.  
  11.  
  12. Command DC
  13. ----------
  14.  
  15. Purpose:  To allow selective copying, moving, deleting and browsing
  16.           of files displayed in a directory listing.
  17.  
  18. Format:   DC [d:][source-path] [d:][dest-path] [/O,N,E,D,or S][/F][/V]
  19.  
  20. Remarks:  
  21.    This program is closely based on the CO and DR programs, both written 
  22. by Michael J. Mefford and published in PC Magazine, vol.6, #17 and #21, 
  23. 1987.  I have combined features from these two programs and also added a 
  24. number of new features of my own.  This program is released into the 
  25. public domain, as is, with no warranties of any kind. I will be happy to 
  26. supply source code to any interested party, with the request that if you 
  27. make any significant changes, modifications, or improvements that you 
  28. please share these changes, preferably in source code form, with me and 
  29. the rest of the PC user community. 
  30.  
  31. Usage notes:
  32.    The source and destination directory pathnames are both optional. 
  33. Options, specified by a "/" followed by a letter, may appear either before 
  34. or after the pathnames.  The options are as follows: 
  35.  
  36. /N      Sort directory by filename
  37. /E      Sort directory by extension
  38. /D      Sort directory by date and time
  39. /S      Sort directory by file size
  40. /O      Use original order, i.e. do not sort directory at all. 
  41. /V      Turn on DOS Verify switch for disk file writes
  42. /F      Fast display on IBM Color display adapters (no snow check)
  43.  
  44.    DC comes up displaying the "source" or "working" directory.  A brief 
  45. menu of optional commands is displayed to the right of the directory 
  46. dispaly.  You may move up and down the directory list with the up and down 
  47. arrow keys on the cursor keypad.  Files may be individually copied, 
  48. deleted, moved or renamed by pressing the function keys F1 through F4, 
  49. respectively.  Alternatively, a number of files may be selected, or 
  50. "marked" using the grey + and - keys on the right side of the keypad.  
  51. After marking, pressing the appropriated function key will apply the 
  52. chosen operation to the entire group of files. 
  53.  
  54.    Different directories can be displayed in two ways.  One is to press 
  55. the F9 function key and enter a new drive and path name.  Alternatively, 
  56. if you want to move to different sub-directories on the same drive, you 
  57. can simply press the "Enter" key after using the up or down arrow keys to 
  58. high-light the desired subdirectory.  Note that as always within DOS, ".." 
  59. denotes the parent of a given subdirectory, i.e. the level above the 
  60. currently displayed directory. 
  61.  
  62.    Just as pressing Enter lets you view a new directory, pressing Enter 
  63. when a filename is highlighted lets you view the contents of the file.  In 
  64. the default mode the display is wrapped at the edge of the screen if a 
  65. line is more than 80 characters wide.  This option can be toggled by 
  66. pressing W.  Display of non-ascii characters can be toggled with the Ascii 
  67. and Blank options by pressing A or B.  In Ascii mode only strings of 5 or 
  68. more normal ascii characters (including tab or space) are displayed.  This 
  69. is useful for viewing the messages conatained in an .EXE or .COM file.  
  70. With the Blank option, non-ascii characters are replaced with a blank or 
  71. space.  A final option, "*", masks the high-order bit of non-ascii 
  72. characters to make wordstar files readable.
  73.  
  74.  
  75. Key by key summary of commands:
  76.  
  77.    Esc     Exit program and return to original directory.
  78.  
  79.   Alt-Q    Exit program leaving the currently displayed dir as the 
  80.            current default drive and directory for DOS.
  81.  
  82.   Grey +   Mark current file entry, if not a subdirectory or hidden 
  83.   or Ins   file, and advance cursor to next line.
  84.  
  85.   Grey -   Remove mark on current file, and advance cursor to next line.
  86.   or Del
  87.  
  88. The following functions operate on the marked files, if any, otherwise
  89. they operate on the currently highlighted file, provided it is not a 
  90. sub-directory entry.  If the operation is successful the mark is 
  91. replaced with an asterix (*), if unsuccessful the file is passed over, 
  92. leaving the mark, and the program proceeds on to the next marked file.
  93.  
  94.     F1      Copy file(s) via a read/write sequence to requested target
  95.  
  96.     F2      Delete file(s) after asking for confirmation.
  97.  
  98.     F3      Move file(s), ie Copy to requested target, delete source.
  99.             Where possible this function is performed using an across 
  100.             directory rename instead of a file read/write sequence.
  101.  
  102.     F4      Rename file(s) or <dir> within the currently displayed directory.
  103.  
  104.     F5      Clear all marks
  105.  
  106.     F6      Mark all remaining files, ie those not marked with an "*".
  107.  
  108.     F7      Swap marked and unmarked files.
  109.  
  110.    The following three functions change the active source and dest 
  111.    directories:
  112.  
  113.     F8      Swap the Working Directory (source) and the Default 
  114.             Destination Directory 
  115.  
  116.     F9      Prompt for a new Working (source) Directory
  117.  
  118.     F10     Prompt for a new Default Destination Directory
  119.  
  120. The directory can be re-sorted by typing:
  121.  
  122.  Alt-N       Sort by filename
  123.  Alt-E       Sort by file extension (eg .COM vs .DOC)
  124.  Alt-D       Sort by date and time
  125.  Alt-S       Sort by file size
  126.  Alt-O       Re-read and display dir in original, unsorted order
  127.  
  128.  Additional commands not appearing in the menu: 
  129.  
  130.  Alt F1      Protected copy - bypass filenamess that already exist on target
  131.  
  132.  Alt R       Re-read working directory.  Required after changing diskettes 
  133.              in a floppy-disk drive. 
  134.  
  135.  Alt C       Copy (Duplicates F1)
  136.  Alt M       Move (Duplicates F3)
  137.  Alt V       View (Duplicates Return)
  138.  
  139.  View Mode commands:
  140.  
  141.  Alt W       Toggle word wrap/horizontal scroll
  142.  Alt A       Toggle Ascii string display
  143.  Alt B       Toggle blanking of non-Ascii characters
  144.    *         Toggle wordstar bit mask (shift non-ascii high-order 
  145.              characters (from 128 to 255) down into the displayable 
  146.              ascii range of 1 to 127. 
  147.  
  148.  
  149. Customizing DC.COM
  150.  
  151. Version 104e of DC can now be customized to display the menu and dir
  152. text in the colors of your choice.  Rather than building into DC.COM an 
  153. automatic color setting function, I have fallen back on the hacker's 
  154. choice of letting you patch DC.COM with debug.  If this scares you, 
  155. learn how to use debug, ask a friend, or learn to love the ridiculous 
  156. choice of colors that is built in to this version.  I use a monochrome 
  157. screen, so it just hasn't been a big thing to me before.
  158.  
  159. Besides understanding DEGUG you need to know two other things: how the 
  160. PC video display cards translates hex numbers into colors, and what 
  161. locations to patch (change) in DC.COM.  The table below lists the 
  162. correspondance between hex numbers and foreground and background colors 
  163. on the PC.  To get the correct number for a combined foreground color 
  164. plus background number, you add the hex digits for the two.  For 
  165. example, brown on a blue background is given by 16h, where as brown on a 
  166. green background is given by 26h.  Note that in a hexidecimal 
  167. representation, which is what debug uses, the first digit is the 
  168. background color, while the second (least significant) digit gives the 
  169. foreground color.
  170.  
  171. Foreground (normal)  Foreground (intense)         Background
  172. --------------------------------------------------------------
  173.  0  black              8   dark gray               0   black  
  174.  1  blue               9   light blue             10h  blue   
  175.  2  green             0Ah  light green            20h  green  
  176.  3  cyan              0Bh  light cyan             30h  cyan   
  177.  4  red               0Ch  light red              40h  red    
  178.  5  magenta           0Dh  light mag.             50h  magenta
  179.  6  brown             0Eh  yellow                 60h  brown  
  180.  7  gray              0Fh  intense white          70h  gray   
  181.  
  182. OK, now you now how to define a color.  If you are a veteran hacker, 
  183. than the next table tells you all you need to know.  If your not, 
  184. hold on, we'll get you there.  
  185.  
  186. Location  Name       Default      Where used
  187. ------------------------------------------------------
  188. 103h      NORMAL       02         Directory display
  189. 104h      INTENSE      0Bh        Pathname display
  190. 105h      MENU         16H        Menu display
  191. 106h      BORDER       1EH        Menu border
  192. 107h      INVERSE      74H        Highlighted dir entry
  193.  
  194. Now, to use DEBUG to change the default colors, first 
  195. (1) Find DEBUG.COM from your DOS disk if you haven't already got it
  196. (2) Use COPY to make a copy of DC.COM on a working disk so you don't 
  197. mess up your one and only copy.
  198. (3) Assuming DEBUG is in the default directory or accessible via the
  199. path command, and that DC.COM is present in the default directory of the 
  200. currently logged disk, type the following (at the DOS prompt):
  201.  
  202. DEBUG DC.COM  (Debug will respond with a hyphen -)
  203. d103l5        (Debug will display the current values of the colors)
  204. e103          (Debug will display the first color, followed by a '.',
  205.               for example 02.  At this point type in the one or two 
  206.               digit number that you want to use for the NORMAL color.  
  207.               If you don't want to change it, press the space bar.  
  208.               After entering the number or a space, debug will go on to 
  209.               the next color, and you repeat the last step until you 
  210.               have entered something for all five colors.  If you want 
  211.               to quit and go back, press the Enter (return) key, and re-
  212.               enter the e103 command at the '-' prompt.  When your done 
  213.               here you only two more steps to go:
  214.               
  215. W             (This command writes the modified file back on to the disk.
  216.               (Debug responds with "Writing 17F3 bytes", or something close)
  217.  
  218. Q             (And the Q command quits DEBUG and returns you to DOS.
  219.               
  220.  
  221. Other Patch Locations:
  222.  
  223. Switch character (108h):
  224.  
  225. For the UNIX hackers, there's one more byte that you can change at your 
  226. pleasure, and that is one I have labeled SWITCH at location 108h in the 
  227. DC.COM file.  The character/byte at location 108h is used to identify an 
  228. option entered on the DOS command line when you first call up DC. 
  229. Normally this is '/', so that options would be specified by /d or /o. By 
  230. changing the byte at location 108 to '-', options can be entered as -d 
  231. or -o.  This lets you use '/' in your path names, so that instead of 
  232. entering command lines like: 
  233.  
  234. DC  C:\COMM\DOWN D:\UTIL /D  
  235.  
  236. You can now enter:
  237.  
  238. DC  C:/COMM/DOWN  D:/UTIL -D    or
  239. DC  C:\COMM\DOWN -d  D:\UTIL    or
  240. DC  -d  C:/COMM\DOWN  D:/UTIL -D 
  241. But not:  DC C:\COMM\DOWN  D:/UTIL /D    (This will clearly confuse DC)
  242.  
  243. (Note that since the problem is with the option switch, and since there 
  244. are no options entered with pathnames once the programming is running, 
  245. you can use either / or \ as a path delimiter when entering a 
  246. destination or changing the path with F9 or F10 keys.)
  247.  
  248.  
  249. Snow Checking (109H):  
  250.  
  251. When DC starts up it checks BIOS data area (Segment 40) to see if the 
  252. current display adapter is a monochrome or color card.  If it isn't mono,
  253. then DC will query the display adapter, before writing a character to the
  254. display memory, to see if it is ok to do so.  This procedure is necessary
  255. to avoid spurious dots or "snow" on old IBM Color Graphics Adapters (CGA's). 
  256. Unfortunately, this also slows things down quite a bit.  If you prefer speed
  257. over a clean display update, or if you have an EGA or other color display
  258. adapter that doesn't need to do this checking, then put 0FFh in the byte
  259. at 109h.  A zero at this location will enable snow checking on all but
  260. the monochrome display adapter (which never needs it anyway).  If you
  261. want to temporarily try out what this patch does, use the /F option 
  262. switch when you start up DC.
  263.  
  264.  
  265. Acknowledgments:
  266.    My thanks to Steve Grandi of U. Arizona for some helpful suggestions.
  267. Steve and I are currently working on revision 1.05 that adds a DOS shell
  268. and some other new functions to DC.  Steve has also implemented a UNIX 
  269. style "-" switch version that uses "/" instead of "\" as the path delimiter.
  270.  
  271. Revision history:
  272.  
  273. DC version 1.04(f) - June 13, 1988
  274.         Add Ins/Del as duplicates to Grey +/- keys
  275.         Fix Backspace bug that occurred on original PC's
  276.         Work on display speed/ cursor overrun problem
  277.         Minor(?) change in memory management
  278.         Last ditch- moved data to end of file to save space
  279.         
  280. DC version 1.03(f)  - May 9, 1988
  281.         Save and restore original text attribute
  282.         Simplify clutter of clear window subroutines
  283.         Add customizable option switchchar for UNIX hacks
  284.         Fix bug occurring in copy of 0 byte size files
  285.         Fix error that occurs when rename is applied to destination dir
  286.         Fix writing to prn once more
  287.         Add Refresh to original order sort
  288.         Minor fixes and revisions to save a few bytes
  289.         Add rename for directories
  290.         More work on error recovery - write protected target
  291.  
  292.  
  293. DC version 1.03  - April 6, 1988
  294.         Add customizable colors and switch-char
  295.         Add Rename for directories
  296.         Automatically re-read dir with Alt-O original order sort
  297.         More work on error recovery - write protected target
  298.  
  299. DC version 1.02 - March 14, 1988
  300.         Added Alt-F1 "Protected Copy" function.
  301.         Tweaked file view function to save 4 bytes.
  302.         Now highlights last sub-dir viewed when returning to parent dir
  303.  
  304. DC version 1.01 - March 7, 1988
  305.         Modified method of handling directory changes
  306.         F9 (change work dir) now relative to displayed work dir
  307.         Allow specifying both source and dest paths on entry
  308.  
  309. Earlier versions COD1 through COD9: Dec '87 to Mar. '88
  310.         Combined DR and CO, 
  311.         Added ability to change directories
  312.         Added more screen info on bytes free
  313.         Added "spedometer" display of marked files, bytes
  314.         Added "View" options to 
  315.                 toggle word wrap, 
  316.                 Horizontal scroll
  317.                 blanking or full suppression of non-ASCII
  318.  
  319.  
  320. Features that could be added:
  321.  
  322.   Sub-directory functions like RMDIR and MKDIR on directories
  323.   Improved error messages on disk not ready, etc
  324.  
  325.   View options:   hex dump a la Buerg's LIST.COM
  326.                   search/scan for text
  327.                   display current horizontal scroll position
  328.                   improve provisions for re-synch in mode toggles
  329. 
  330.